<?php

class dbaLang {

   function dbaLang(&$dba){
     $this->dba = &$dba;
   }
   
   function getLanguages(&$data,$ordered = false){
     if ($ordered){
       $orderStr = ' order by name';
     }
     $check = $this->dba->query("select * from ".$this->dba->tableforwarder."_shopLang$orderStr;");
     $data  = $this->dba->fetch_rows_array();
     return $check;
   }

   function getLangID($name){
     $this->dba->query("select id from ".$this->dba->tableforwarder."_shopLang where name='$name';");
     $row = $this->dba->fetch_row_array();
     return $row['id'];
   }

   function getLanguage(&$result,$id){
     $check  = $this->dba->query("select * from ".$this->dba->tableforwarder."_shopLang where id = $id;");
     $result = $this->dba->fetch_row_array();
     return $check;
   }

   function delLanguage($id){
     return $this->dba->query("delete from ".$this->dba->tableforwarder."_shopLang where id = $id;");
   }

   function updateLanguage($id,$name){
     return $this->dba->query("update ".$this->dba->tableforwarder."_shopLang set name='$name' where id = $id;");
   }

   function addLanguage($name){
     return $this->dba->query("insert into ".$this->dba->tableforwarder."_shopLang (name) values ('$name')");
   }
}

?>